-- GENERATED SPELL FOR [Elder Stonebark] --


function spell0_32914(pUnit, Event) --@Drained of Power,Self--
pUnit:FullCastSpellOnTarget(62467,pUnit)
pUnit:RegisterEvent('Sorts_32914', 623, 1)
end

function spell1_32914(pUnit, Event) --@Fists of Stone,Self--
pUnit:FullCastSpellOnTarget(62344,pUnit)
pUnit:RegisterEvent('Sorts_32914', 12500, 1)
end

function spell2_32914(pUnit, Event) --@Ground Tremor,Self--
pUnit:FullCastSpellOnTarget(62325,pUnit)
pUnit:RegisterEvent('Sorts_32914', 10000, 1)
end

function spell3_32914(pUnit, Event) --@Ground Tremor,Self--
pUnit:FullCastSpellOnTarget(62932,pUnit)
pUnit:RegisterEvent('Sorts_32914', 10000, 1)
end

function spell4_32914(pUnit, Event) --@Petrified Bark,Self--
pUnit:FullCastSpellOnTarget(62337,pUnit)
pUnit:RegisterEvent('Sorts_32914', 32000, 1)
end

function spell5_32914(pUnit, Event) --@Petrified Bark,Self--
pUnit:FullCastSpellOnTarget(62933,pUnit)
pUnit:RegisterEvent('Sorts_32914', 32000, 1)
end

function Sorts_32914(pUnit, Event)
local choix_sorts_32914 = math.random(0, 5)
if choix_sorts_32914 == 0 then
pUnit:RegisterEvent('spell0_32914', 1, 1)
end
if choix_sorts_32914 == 1 then
pUnit:RegisterEvent('spell1_32914', 1, 1)
end
if choix_sorts_32914 == 2 then
pUnit:RegisterEvent('spell2_32914', 1, 1)
end
if choix_sorts_32914 == 3 then
pUnit:RegisterEvent('spell3_32914', 1, 1)
end
if choix_sorts_32914 == 4 then
pUnit:RegisterEvent('spell4_32914', 1, 1)
end
if choix_sorts_32914 == 5 then
pUnit:RegisterEvent('spell5_32914', 1, 1)
end
end

function mob32914_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_32914', math.random(1500, 3000), 1)
end

function mob32914_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32914_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32914_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(32914, 1, 'mob32914_Action')
RegisterUnitEvent(32914, 2, 'mob32914_Leave')
RegisterUnitEvent(32914, 3, 'mob32914_Kill')
RegisterUnitEvent(32914, 4, 'mob32914_Die')
